﻿<MRow Align="@AlignTypes.Center"
      Justify="@JustifyTypes.Center">
    <MCard Style="height:300px;width:250px">
        <MRow Justify="@JustifyTypes.Center">
            <MButton Color="orange lighten-2"
                     Style="margin-top:24px"
                     OnClick="Toggle">
                Show Overlay
            </MButton>

            <MOverlay Contained
                      Opacity="1.0"
                      Value="overlay">
                <MButton Color="orange lighten-2"
                         OnClick="Hide">
                    Hide Overlay
                </MButton>
            </MOverlay>
        </MRow>
    </MCard>
</MRow>
@code {
    bool overlay = false;

    void Toggle(MouseEventArgs args)
    {
        overlay = !overlay;
    }

    void Hide(MouseEventArgs args)
    {
        overlay = false;
    }
}